% V20210224 - 11.2 GW_ADD_DIALOG_CHECKBOX INCLUDE "GW.bas" % Create a page. p = GW_NEW_PAGE() % Prepare title bar string. Title$ = GW_ADD_BAR_TITLE$("DialogCheckbox Example") % Add title to page. GW_ADD_TITLEBAR(p,Title$) % Add descriptive text. GW_ADD_TEXTBOX(p, "This is an example of the DIALOG_CHECKBOX control:") % Add button to activate the dialog. GW_ADD_BUTTON(p, "Let's do this!", "show") % Add a text area. tt = GW_ADD_TEXTBOX(p, "Dialog not displayed") % Let's prepare the dialog. ARRAY.LOAD a$[], "OK>done", "Not OK>cancel" Dlg = GW_ADD_DIALOG_CHECKBOX(p, "My Dialog", "A message from our sponsor", "Check please!", a$[]) % Now show the page. GW_RENDER(p) DO % Wait for user action. r$ = GW_WAIT_ACTION$() % Place here any necessary code to process user actions. % Parse user action. SW.BEGIN r$ % Test for button press. SW.CASE "show" GW_SHOW_DIALOG(Dlg) SW.BREAK % Test for first dialog pick. SW.CASE "done" POPUP "OK was picked" SW.BREAK % Test for second dialog pick. SW.CASE "cancel" POPUP "Not OK was picked" SW.BREAK SW.END % Test for check status. IF GW_CHECKBOX_CHECKED(Dlg) then GW_MODIFY(tt, "text", "Checked") ELSE GW_MODIFY(tt, "text", "Not Checked") ENDIF % End when BACK key is pressed. UNTIL r$ = "BACK" END "End of DialogCheckbox example."